<template>
  <window class="m-import-detail" ref="win" title="修改历史记录">
    <div>
      <el-table
        :data="tableData"
        border
        empty-text="暂无数据"
        stripe
        style="min-width: 100%">
        <el-table-column
          prop="operatorName"
          align="center"
          label="修改人">
        </el-table-column>
        <el-table-column
          prop="studentName"
          align="center"
          label="修改时间">
          <template scope="scope">
            <div>{{scope.row.updateTime | formatTime}}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="coefficientPerformance"
          align="center"
          label="绩效系数">
        </el-table-column>
      </el-table>
      <div class="am-u-lg-12 am-cf">
        <div class="am-fr">
          <pagination v-bind:total="total" v-bind:pageNo="pageNo" v-bind:pageSize="pageSize"
                      @paging="findHistoryByEmployee"/>
        </div>
      </div>
    </div>
  </window>
</template>

<script>
  import io from '../../lib/io'
  import Pagination from '../base/Pagination'

  export default{
    data: function () {
      return {
        tableData: [],
        total: 0,
        pageSize: 10,
        pageNo: 1,
        employeeId: '',
      }
    },
    components : {
      Pagination
    },
    methods:{
      findHistoryByEmployee (pageNo) {
        this.pageNo = pageNo || this.pageNo || 1
        io.post(io.findHistoryByEmployeeId, {
          employeeId: this.employeeId,
          pageSize: this.pageSize,
          pageNo: this.pageNo,
        }, (ret) => {
          if (ret.success) {
            this.tableData = ret.data.list || []
            this.total = ret.data.total || 0
          } else {
            this.$alert(ret.desc)
          }
        })
      },
      show:function(){
        this.$refs.win.show( { width : 1000 } )
        this.findHistoryByEmployee()
      }
    }
  }

</script>
